Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recognize log level in Elasticsearch JVM logs #34159

Merged
merged 9 commits into from
Jan 9, 2023

Conversation

danielmitterdorfer
Copy link
Member

@danielmitterdorfer danielmitterdorfer commented Jan 3, 2023

What does this PR do?

Elasticsearch will add a log level to its JVM logs to allow users to help them detect errors / warnings more easily in elastic/elasticsearch#92382. With this commit we detect this new field if present and continue to recognize the prior log format which does not contain a log level.

Why is it important?

This change is required to keep compatibility with Elasticsearch's JVM log output.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Related issues

Relates elastic/elasticsearch#92382
Closes #34054

Elasticsearch will add a log level to its JVM logs to allow users to
help them detect errors / warnings more easily. With this commit we
detect this new field if present and continue to recognize the prior log
format without a log level.

Relates elastic/elasticsearch#92382
Closes elastic#34054
@danielmitterdorfer danielmitterdorfer requested a review from a team as a code owner January 3, 2023 08:12
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jan 3, 2023
@botelastic
Copy link

botelastic bot commented Jan 3, 2023

This pull request doesn't have a Team:<team> label.

@mergify
Copy link
Contributor

mergify bot commented Jan 3, 2023

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @danielmitterdorfer? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

@danielmitterdorfer
Copy link
Member Author

There is one thing where I'm specifically looking for guidance from reviewers. In line with elasticsearch.gc.tags, I've put the log level in elasticsearch.gc.level but I wonder whether it makes more sense to put it into log.level instead.

@elasticmachine
Copy link
Collaborator

elasticmachine commented Jan 3, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-01-09T06:58:53.995+0000

  • Duration: 72 min 28 sec

Test stats 🧪

Test Results
Failed 0
Passed 7203
Skipped 738
Total 7941

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@danielmitterdorfer danielmitterdorfer requested a review from a team as a code owner January 3, 2023 08:42
@danielmitterdorfer danielmitterdorfer requested review from belimawr and removed request for a team January 3, 2023 08:43
@danielmitterdorfer
Copy link
Member Author

x-pack/filebeat-pythonIntegTest is currently failing but none of the failing tests are related to the Elasticsearch module (the failures are in cyberarkpa and cisco).

@ruflin
Copy link
Member

ruflin commented Jan 4, 2023

Lets make sure, any change we add here also makes it into the integrations package: https://github.com/elastic/integrations/tree/main/packages/elasticsearch/data_stream/gc

@danielmitterdorfer
Copy link
Member Author

Lee has already opened an issue for that: elastic/integrations#4842. :)

Copy link
Contributor

@leehinman leehinman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think log.level is the way to go, otherwise everything looks great.

@danielmitterdorfer
Copy link
Member Author

I think log.level is the way to go, otherwise everything looks great.

Great, thanks for having a look @leehinman . Is this as simple as just changing the grok pattern from

(\[%{DATA:elasticsearch.gc.level}%{SPACE}\])?

to

(\[%{DATA:log.level}%{SPACE}\])?

or am I missing something?

@danielmitterdorfer
Copy link
Member Author

I've pushed the rename now in 24cf0bb. @leehinman can you please take another look?

@miltonhultgren
Copy link
Contributor

miltonhultgren commented Jan 4, 2023

Lee has already opened an issue for that: elastic/integrations#4842. :)

@danielmitterdorfer When will that work be done and by whom? My team is tagged for it but it's not planned on our part.

@danielmitterdorfer
Copy link
Member Author

@danielmitterdorfer When will that work be done and by whom? My team is tagged for it but it's not planned on our part.

@miltonhultgren I would hope it's not much effort once this change is in (basically copy & paste what's done here)? I'd like to see this change being released with 8.7.0. I can attempt to do this myself but will require some guidance.

Copy link
Contributor

@leehinman leehinman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@leehinman
Copy link
Contributor

@danielmitterdorfer When will that work be done and by whom? My team is tagged for it but it's not planned on our part.

@miltonhultgren I would hope it's not much effort once this change is in (basically copy & paste what's done here)? I'd like to see this change being released with 8.7.0. I can attempt to do this myself but will require some guidance.

Let me know if you want help.

@miltonhultgren
Copy link
Contributor

@danielmitterdorfer @leehinman Okay, I had to confirm with our expert about what would be affected but it seems like a small change so I think we can handle that, I'm putting it into our queue!

@danielmitterdorfer
Copy link
Member Author

@miltonhultgren thanks for taking care of the changes on the integrations side!

@leehinman The changes are now approved and all PR checks are green but I am not authorized to merge the PR. Could you please merge the PR on my behalf? Thank you!

@leehinman leehinman merged commit 27b8103 into elastic:main Jan 9, 2023
@danielmitterdorfer danielmitterdorfer deleted the es-jvm-log-level branch January 9, 2023 15:30
chrisberkhout pushed a commit that referenced this pull request Jun 1, 2023
* Recognize log level in Elasticsearch JVM logs

Elasticsearch will add a log level to its JVM logs to allow users to
help them detect errors / warnings more easily. With this commit we
detect this new field if present and continue to recognize the prior log
format without a log level.

Relates elastic/elasticsearch#92382
Closes #34054
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Filebeat Filebeat Module:elasticsearch Elasticsearch Beats modules needs_team Indicates that the issue/PR needs a Team:* label v8.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add GC log level for Elasticsearch
5 participants